Boook club R-Ladies Bergen, R-Ladies Den Bosch, R-Ladies Amsterdam
We can look at the Code, Preview (rendered code) and Blame
Blame is analogous to git blame
If you want to propose a change to someone else’s repo
When in doubt, use ‘fork and clone’ over ‘just clone’
Method A: Browser, command line and RStudio
Method B: Using usethis::create_from_github()
Click fork on the Github page of the original repo (OWNER/REPO) - creates a copy in your account (YOU/REPO)
Clone the newly create YOU/REPO onto your machine
Highly recommended: Configure the upstream remote in one of these ways
git remote add upstream https://github.com/OWNER/REPO.git
usethis::use_git_remote(name = "upstream", url = "https://github.com/OWNER/REPO.git")
Clicking on new branch and pasting the link of the original rep
Use git fetch upstream to pull changes from the upstream
Use git branch -u upstream/main to set the original repo as the tracking branch for your local branch
Pushes to and pulls from the original repo automatically
create_from_github()usethis::create_from_github("https://github.com/OWNER/REPO")
Download Github Desktop and connect your Github account
Fork the repository in Github, then clone
create_from_github()git remote -vgit remote show originDo not make commits to the main of a repo you have forked - this will create discrepancies
Instead: Use a pull request
It’s recommended to always work in a new branch and not in the main of your forked repo
In this case no problem, we can sync the fork
However, we may run into issues
List your remotes:
git remote -v in the command line
usethis::git_remotes() in the console
Use git branch -vv to view the upstream tracking branch
git pull upstream main --ff-only and then git push origin mainOne of Github’s advantages is that you can browse repositories in the browser
Derived products may be useful to your audience - so you may want to consider keeping file formats such as .md which can be viewed on Github
You can tweak a few options in the R Markdown settings to make it more Github-friendly
Keep the .md file
[R-Ladies Book Club]